from flask import Blueprint, render_template, request, redirect, url_for

# 创建一个用户蓝图
user_bp = Blueprint('user', __name__)

# 用户首页
@user_bp.route('/')
def user_home():
    return "Welcome to the User Home Page!"

# 用户登录页面
@user_bp.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'POST':
        username = request.form.get('username')
        password = request.form.get('password')
        # 这里可以添加登录验证逻辑
        return f"Logged in as {username}"
    return render_template('login.html')